<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty {js}{/js} block plugin
 *
 * Type:     block function<br>
 * Name:     js<br>
 * Purpose:  escape a text block for JS litteral affectation<br>
 * @param array not used here
 * @author Clement Nodet <clement dot nodet at dirox dot net>
 * @param string contents of the block
 * @param Smarty clever simulation of a method
 * @return string string $content re-formatted
 */
function smarty_block_js($params, $content, &$smarty)
{
    if (is_null($content)) {
        return;
    }

    return StringUtil::escapeUTF8ToJS($content);

}

/* vim: set expandtab: */

?>
